package com.foreknow.view;

import com.foreknow.bean.User;
import com.foreknow.dao.UserDao;
import com.foreknow.dao.impl.UserDaoImpl;
import com.foreknow.service.impl.UserServiceImpl;

public class MainWindow {
    public static void main(String[] args) {
        UserServiceImpl service = new UserServiceImpl();
        UserDao userDao = new UserDaoImpl();
        //需要调用set方法给userDao进行初始化
        service.setUserDao(userDao);
        User user = new User();
        user.setUid("s1001");
        user.setName("fender");
        user.setAge(60);
        //调用service层的方法
        service.save(user);
    }
}
